// 云函数入口文件
//修改卖场
const cloud = require('wx-server-sdk')
cloud.init({
    env: "cloudwx-dm78q"
})
DB = cloud.database().collection("market");

cloud.init()

// 云函数入口函数
exports.main = async(event, context) => {
    //修改该id的数据
    return DB.doc(event.newData.id).update({
            data: {
                name: event.newData.name,
                address: event.newData.address,
                contact: event.newData.contact,
                number: event.newData.number,
                phone: event.newData.phone,
                picturl: event.newData.picturl
            }
        })
        .then(res => {
            console.log(res);
            this.clearInput();
        }).catch(console.error)

}